package com.atguigu.gmall.all.controller;

import com.atguigu.gmall.order.client.OrderFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Map;

/**
 * @author gsy
 * @date 2021年09月10日20:13
 * Description
 */
@Controller
public class OrderController {
    @Autowired
    private OrderFeignClient orderFeignClient;


    //订单页面查询和渲染
    @GetMapping("/trade.html")
    public String trade(Model model){
        //查询订单
        Map map = orderFeignClient.trade();
        //回显订单信息
        model.addAllAttributes(map);

        return "order/trade";
    }
}
